home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MSG Graphic Effects 1.0 Source / Caste wipe.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-23  |  1.7 KB  |  51 lines  |  [TEXT/KAHL]

  1. /*******************************************************************************
  2.  * Copyright © 1992-1993 Mark Pilgrim                                          *
  3.  *                                                                             *
  4.  * This file is provided as is, and may be freely distributed unaltered.  This *
  5.  * message must accompany any copy of this file.  This file may be used or     *
  6.  * modified for use for a non-commercial product provided that appropriate     *
  7.  * credit is given to the author named above.                                  *
  8.  * Commercial use of this source code is prohibited.                           *
  9.  ******************************************************************************/
  10.  
  11. #include "msg misc.h"
  12. #include "msg timing.h"
  13.  
  14. #define        gap                10
  15. #define CorrectTime 1
  16.  
  17. void CasteWipe(GrafPtr);
  18.  
  19. /* This takes a strip (starting with the topmost strip, moving down) and copies
  20.    it into all the strips starting with the bottom and moving up until it's in
  21.    the right place. */
  22.    
  23. void CasteWipe(GrafPtr sourceGrafPtr)
  24. {
  25.     int        srcy, barpos;
  26.     Rect    src, dest;
  27.     Boolean    everyOther;
  28.     
  29.     everyOther=FALSE;
  30.     src.left = 0;
  31.     src.right = MAIN_WINDOW_WIDTH;
  32.     
  33.     for(srcy = 0; srcy < MAIN_WINDOW_HEIGHT; srcy += gap)
  34.     {
  35.         for(barpos = 0; barpos + gap < MAIN_WINDOW_HEIGHT; barpos += gap);
  36.         for(; barpos >= srcy; barpos -= gap)
  37.         {
  38.             StartTiming();
  39.             src.top = srcy;
  40.             src.bottom = srcy + gap;
  41.             dest = src;
  42.             dest.top = barpos;
  43.             dest.bottom = barpos + gap;
  44.             CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
  45.                     &src, &dest, 0, 0L);
  46.             if (everyOther)                      /* simulates time correction 0.5 */
  47.                 TimeCorrection(CorrectTime);
  48.             everyOther=!everyOther;
  49.         }
  50.     }
  51. }